package org.geometerplus.zlibrary.ui.android.view;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.TextView;

public class BookCoverLableTextView extends TextView {
	private int mRotateDegree = 90;

	public BookCoverLableTextView(Context context) {
		super(context);
	}

	public BookCoverLableTextView(Context context, AttributeSet attrs) {
		super(context, attrs);

	}

	public BookCoverLableTextView(Context context, AttributeSet attrs,
			int defStyle) {
		super(context, attrs, defStyle);
	}

	public int getMrotate() {
		return mRotateDegree;
	}

	public void setMrotate(int mrotate) {
		mRotateDegree = mrotate;
	}

	protected void onDraw(Canvas canvas) {
		canvas.translate(getHeight(), 0);
		canvas.rotate(mRotateDegree);
		super.onDraw(canvas);
	}

	protected void onMeasury(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		setMeasuredDimension(200, 200);
	}
}
